/*
 * Copyright (c) 2010, VeRSI Consortium
 *   (Victorian eResearch Strategic Initiative, Australia)
 * All rights reserved.
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of the VeRSI, the VeRSI Consortium members, nor the
 *       names of its contributors may be used to endorse or promote products
 *       derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
package versi.vitro.oaiserviceprovider.service.jena.api;

import com.hp.hpl.jena.rdf.model.ModelMaker;


/**
 * Service for connecting to the Jena triple store. These methods are not
 * referred directly in the source code apart from unit tests. Instead Spring
 * calls the JenaConnManager.getObject method to obtain a ModelMaker instance
 * that is injected into other beans. As part of that process a connection is
 * established via a call to JenaConnManager.connect. Spring makes a call to
 * JenaConnManager.disconnect when the application terminates. Refer to the
 * applicationContext.xml files for further information.
 */
public interface JenaConnManager {

    /**
     * Opens connection to triple store. Called by Spring indirectly only.
     */
    JenaConnManager connect();

    /**
     * Closes connection to triple store. Called by Spring only.
     */
    void disconnect();

    /**
     * Gets Jena Model Maker. The model make becomes available once the
     * connection to the triple store is established. Spring calls this method
     * indirectly vis a call to getObject.
     * 
     * @return ModelMaker Jena Model Maker.
     */
    ModelMaker getModelMaker();

}
